<?php
require_once(dirname(__FILE__)."/../inc/common.php");
/*******************************************************************************************
'*******************************************************************************************/
if (newsrunMode=="static"){
	header(getNewsIndexLink());
}else{
	GetNewsIndex();
}

function GetNewsIndex(){
	global $t1;
	$x = DJCMS_TEMPLATE."newsindex.html";
	$cacheName="parsed_news_index";
	if (cacheStart == 1){
		if (djcms::$content = memory('get', $cacheName)) {
        } else {
            parseNewsPart($x);
            memory('set', $cacheName, djcms::$content);
        }
	} else {
		parseNewsPart($x);
	}
	echo replaceStr(djcms::$content,"{yh:runinfo}",getRunTime($t1)) ;
}

function parseNewsPart($x)
{
	djcms::$content=loadFile($x);
	djcms::parseTopAndFoot();
	djcms::parseSelf();
	djcms::parseGlobal();
	djcms::$content=replaceCurrentTypeId(djcms::$content);
	djcms::parseMenuList("");
	djcms::parseNewsList();
	djcms::parseAreaList();
	djcms::parseVideoList();
	djcms::parseTopicList();
	djcms::parseLinkList();
	djcms::parseIf();
}
?>
